package com.strongbj.iot.devices.newlight.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.strongbj.iot.devices.newlight.entity.BindNum;
import com.strongbj.iot.devices.newlight.entity.Reader;
import com.strongbj.iot.devices.newlight.mapper.ReaderMapper;
import com.strongbj.iot.devices.newlight.service.ReaderService;

@Service("readerService")
public class ReaderServiceImpl extends ServiceImpl<ReaderMapper, Reader> implements ReaderService{

	@Autowired
	private ReaderMapper readerMapper;
	
	@Override
	public List<Reader> getReadersByRoom(String room) {
		QueryWrapper<Reader> warpper = new QueryWrapper<Reader>();
		warpper.eq("room_", room);
		return readerMapper.selectList(warpper);
	}

	@Override
	public BindNum getBindNumByCode(String code) {
		return readerMapper.selectBindNumByCode(code);
	}
}
